package m.jclecai.com.fragment.klpk;


import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.ArrayList;
import java.util.List;

import m.jclecai.com.fragment.klpk.pager.BasePagerFragment;

public class MyPagerAdapter extends FragmentPagerAdapter {

    List<BasePagerFragment> mList;

    public MyPagerAdapter(FragmentManager fm) {
        super(fm);
        mList=new ArrayList<>();
    }

    public  void addItem(BasePagerFragment baseFragment){
        mList.add(baseFragment);
    }

    @Override
    public Fragment getItem(int position) {
        return mList.get(position);
    }

    @Override
    public int getCount() {
        return mList.size();
    }


    public List<BasePagerFragment> getData(){
        return mList;
    }
}
